from redlock import RedLock

# addrs = [{
#     "host": "10.10.80.200",
#     'port': 7003,
#     "db": 0
# }, {
#     "host": "10.10.80.200",
#     'port': 7004,
#     "db": 0
# }, {
#     "host": "10.10.80.200",
#     'port': 7005,
#     "db": 0
# }, {
#     "host": "10.10.80.200",
#     'port': 7006,
#     "db": 0
# }, {
#     "host": "10.10.80.200",
#     'port': 7007,
#     "db": 0
# }, {
#     "host": "10.10.80.200",
#     'port': 7008,
#     "db": 0
# }]

with RedLock("distributed_lock",
             connection_details=[
                 {'host': '10.10.80.200', 'port': 7003, 'db': 0, 'password': '123456'},
                 {'host': '10.10.80.200', 'port': 7004, 'db': 0, 'password': '123456'},
                 {'host': '10.10.80.200', 'port': 7005, 'db': 0, 'password': '123456'},
                 {'host': '10.10.80.200', 'port': 7006, 'db': 0, 'password': '123456'},
                 {'host': '10.10.80.200', 'port': 7007, 'db': 0, 'password': '123456'},
                 {'host': '10.10.80.200', 'port': 7008, 'db': 0, 'password': '123456'},
             ]
             ):
    print('get lock')
